<!DOCTYPE html>
<html>

<head>
    <meta content="telephone=no" name="format-detection">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Language" content="zh-CN">
    <meta http-equiv="x-ua-compatible" content="IE=edge, chrome=1">
    <meta name="viewport"
        content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <meta name="keywords" content="关键词" />
    <meta name="description" content="页面简介" />
    <link rel="icon" href="favicon.ico" />
    <link rel="shortcut icon" href="favicon.ico" />
    <link href="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
    <link href="csaa/css/style.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="./csaa/fonts/iconfont/iconfont.css">
    <link rel="stylesheet" href="./csaa/fonts/materialicons/material-icons.css">

    <script language="javascript" type="text/javascript" src="./csaa/js/jquery.min.js"></script>
    <script src="./csaa/js/httpPath.js"></script>
    <script src="./csaa/js/httpUtils.js"></script>
    <script language="javascript" type="text/javascript" src="./csaa/js/site.js"></script>
    <title>全国青少年航空科学素质等级考试</title>
    <style>
        .clause_btnone {
            color: #0081e7 !important;
        }

        #subplate_clauseone .title {
            font-size: 16px;
            color: #000;
            font-weight: bold;
            padding: 40px 0 20px 0;
            text-align: center;
        }

        .closes {
            width: 100%;
            height: 100%;
            color: #fff;
            background-color: #045db9;
            border: 1px solid #045db9;
            cursor: pointer;
        }

        .closeone {
            width: 100%;
            height: 100%;
            color: #fff;
            background-color: #045db9;
            border: 1px solid #045db9;
            cursor: pointer;
        }
    </style>
</head>

<body class="register" style="background-color: #efefef;">
    <!-- 头部 开始 -->
    <div class="header login_header ">

    </div>
    <!-- 头部 结束 -->




    <!-- 主体 开始 -->
    <div id="register_main">
        <div class="register_content limitwidth register_kaodian_form">

            <div class="form_box">
                <form id="register_form" autocomplete="off">
                    <div class="part_title">考点注册</div>
                    <div class="form_group">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>用户名</div>
                        </label>
                        <div class="form_item_con">
                            <input type="text" class="form_input rowwidth_30" name="account_number" maxlength="25"
                                onkeyup="value=value.replace(/[\u4e00-\u9fa5]/ig,'')">
                            <p class="tips">用户名请输入英文字母或数字</p>
                        </div>
                    </div>
                    <div class="form_group">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>密码</div>
                        </label>
                        <div class="form_item_con">
                            <input type="password" class="form_input rowwidth_30" name="password" maxlength="25">
                        </div>
                    </div>
                    <div class="form_group">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>考点名称</div>
                        </label>
                        <div class="form_item_con">
                            <input type="text" class="form_input rowwidth_50" name="company">
                        </div>
                    </div>
                    <div class="form_group" id="enroll_otherchild">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>考点地址</div>
                        </label>
                        <div class="form_item_con">
                            <select class="form_input form_select rowwidth_10" placeholder="省份" name="province"
                                id="province">
                                <option>省份</option>
                            </select>
                            <select class="form_input form_select rowwidth_10" placeholder="地级市" name="city" id="city">
                                <option>地级市</option>
                            </select>
                            <select class="form_input form_select rowwidth_20" placeholder="市、县级市、县" name="area"
                                id="area">
                                <option>市、县级市、县</option>
                            </select>
                            <input type="text" class="form_input form_select rowwidth_30" placeholder="请输入详细地址"
                                name="detail_area">
                        </div>
                    </div>
                    <div class="form_group">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>考点定位</div>
                        </label>
                        <!-- <div class="form_item_con">

							<label >纬度：</label>
							<input type="text" id="lat" name="lat" class="form_input rowwidth_30"  value="" readonly>

							<label>经度：</label>
							<input type="text" id="lng" name="lng" class="form_input rowwidth_30" value="" readonly>

							<label>地址 ：</label>
							<input type="text" id="address" name="address" class="form_input rowwidth_30" readonly>

							<button type="button" class="btn btn_color_1" id="open">点击显示地图获取地址经纬度</button>
							<div id='allmap'></div>
						</div> -->
                        <div class="form_item_con">
                            <input id="address" type="text" name="companyAddress" required lay-verify="required"
                                placeholder="请输入，如：北京市天安门" autocomplete="on" class="form_input rowwidth_30">
                            <p class="tips">输入关键词后，请选择下拉框中的地址</p>
                        </div>
                    </div>
                    <div class="form_group">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>考点负责人姓名</div>
                        </label>
                        <div class="form_item_con">
                            <input type="text" class="form_input rowwidth_30" name="fuze_name">
                        </div>
                    </div>
                    <div class="form_group">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>负责人职务</div>
                        </label>
                        <div class="form_item_con">
                            <input type="text" class="form_input rowwidth_30" name="fuze_job">
                        </div>
                    </div>
                    <div class="form_group">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>负责人联系方式</div>
                        </label>
                        <div class="form_item_con">
                            <input type="text" class="form_input rowwidth_30" name="fuze_phone">
                        </div>
                    </div>
                    <div class="form_group">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>考点联系邮箱</div>
                        </label>
                        <div class="form_item_con">
                            <input type="text" class="form_input rowwidth_30" name="kaodian_email">
                        </div>
                    </div>
                    <div class="form_group">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>考点固话</div>
                        </label>
                        <div class="form_item_con">
                            <input type="text" class="form_input rowwidth_30" name="kaodian_tel"
                                onkeyup="value=value.replace(/[\u4e00-\u9fa5]/ig,'')" placeholder="请输入，如：010-12345678">
                        </div>
                    </div>
                    <div class="form_group upload_img" id="license_upload">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>单位执照</div>
                        </label>
                        <div class="form_item_con">
                            <div class="review_imgbox_wrap">
                                <div class="review_imgbox">
                                </div>
                                <div class="review_imguploadfile_wrap">
                                    <div class="review_imguploadfile_plus form_imgupload"></div>
                                    <input type="file" name="imguploadfile" id="imguploadfile"
                                        class="form_input imguploadfile" />
                                </div>
                            </div>
                            <p class="tips">请选择（.jpg/.jpeg/.png，不超过1024KB）</p>
                        </div>
                    </div>
                    <div class="form_group upload_img" id="changdi_upload">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>场地照片</div>
                        </label>
                        <div class="form_item_con">
                            <div class="review_imgbox_wrap">
                                <div class="review_imgbox">
                                </div>
                                <div class="review_imguploadfile_wrap">
                                    <div class="review_imguploadfile_plus form_imgupload"></div>
                                    <input type="file" name="imguploadfile" id="imguploadfile"
                                        class="form_input imguploadfile" />
                                </div>
                            </div>
                            <p class="tips">请选择（.jpg/.jpeg/.png，不超过1024KB）</p>
                        </div>
                    </div>
                    <div class="form_group upload_img" id="class_upload">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>教室照片</div>
                        </label>
                        <div class="form_item_con">
                            <div class="review_imgbox_wrap">
                                <div class="review_imgbox">
                                </div>
                                <div class="review_imguploadfile_wrap">
                                    <div class="review_imguploadfile_plus form_imgupload"></div>
                                    <input type="file" name="imguploadfile" id="imguploadfile"
                                        class="form_input imguploadfile" />
                                </div>
                            </div>
                            <p class="tips">请选择（.jpg/.jpeg/.png，不超过1024KB）</p>
                        </div>
                    </div>
                    <div class="form_group upload_img" id="gate_upload">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>正门照片</div>
                        </label>
                        <div class="form_item_con">
                            <div class="review_imgbox_wrap">
                                <div class="review_imgbox">
                                </div>
                                <div class="review_imguploadfile_wrap">
                                    <div class="review_imguploadfile_plus form_imgupload"></div>
                                    <input type="file" name="imguploadfile" id="imguploadfile"
                                        class="form_input imguploadfile" />
                                </div>
                            </div>
                            <p class="tips">请选择（.jpg/.jpeg/.png，不超过1024KB）</p>
                        </div>
                    </div>
                    <div class="form_group">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>上传文档</div>
                        </label>
                        <div class="form_item_con form_row">
                            <input type="file" class="form_input rowwidth_30 fileUrl" name="fileUrl" id="fileUrl">
                            <!-- <input type="button" class="btn btn_color_1 btn_upload" value="上传" /> -->
                            <div class="progress rowwidth_30">
                                <div class="progress-bar-striped progress-bar progress-bar-info active"
                                    id="mt-progress-length" style="width: 0%;">
                                    <!-- <div class="progress-value" id="mt-progress-value">0%</div> -->
                                </div>
                            </div>
                            <span id="proInfo">上传进度：0%</span>
                            <div class="review_filebox rowwidth_30">
                                <!-- <div class="fileitem">
                                    <div class="text">rtjrtjrtj</div>
                                    <div class="del">删除</div>
                                </div> -->
                            </div>
                            <p class="tips">考点申报资料，请上传（.doc/.docx/.pdf，不超过2048KB）</p>
                        </div>
                    </div>
                    <div class="form_group">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>考点联系人姓名</div>
                        </label>
                        <div class="form_item_con">
                            <input type="text" class="form_input rowwidth_30" name="kaowu_name">
                        </div>
                    </div>
                    <div class="form_group">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>考点联系人职务</div>
                        </label>
                        <div class="form_item_con">
                            <input type="text" class="form_input rowwidth_30" name="kaowu_job">
                        </div>
                    </div>
                    <div class="form_group">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>考点联系人手机号</div>
                        </label>
                        <div class="form_item_con">
                            <input type="text" class="form_input rowwidth_30" name="kaowu_phone">
                        </div>
                    </div>
                    <div class="form_group">
                        <label class="form_label">
                            <div class="cn"><span class="star">*</span>短信验证码</div>
                        </label>
                        <div class="form_item_con">
                            <div class="form_row">
                                <input type="text" class="form_input rowwidth_20" name="enroll_verification_code">
                                <button type="button" id="btn_verification"
                                    class="btn btn_color_1 btn_primary">获取验证码</button>
                            </div>
                        </div>
                    </div>
                    <div class="form_group">
                        <label class="form_label">
                            <div class="cn"></div>
                        </label>
                        <div class="form_item_con form_check form_clause_wrap">
                            <input type="checkbox" name="clause">
                            <span>同意<a class="clause_btn">《考点注册须知》</a>规则</span>
                        </div>
                    </div>
                    <div class="form_group">
                        <label class="form_label">
                            <div class="cn"></div>
                        </label>
                        <div class="form_item_con form_check form_clause_wrap">
                            <input type="checkbox" name="clauseone">
                            <span>同意<a class="clause_btnone">《信息保密须知》</a>规则</span>
                        </div>
                    </div>
                    <div class="form_group form_manage">
                        <label class="form_label"></label>
                        <div class="form_item_con">
                            <div class="manage_wrap">
                                <a id="btn_sumbit" class="btn btn_color_1 btn_sumbit">立即提交</a>
                            </div>
                        </div>
                    </div>
                </form>
            </div>

        </div>
        <div class="footer">@ 全国青少年无人机科学素质等级考试</div>

    </div>
    <!-- 主体 结束 -->

    <!-- 上传图片 开始 -->
    <div id="part_imgupload" class="subplate_wrap hide">
        <div class="mask"></div>
        <div class="subplate part_imgupload">
            <div class="imgupload_preview_box">
                <img data-blank="./csaa/img/img_blank.png" src="./csaa/img/img_blank.png" id="imgupload_preview"
                    class="imgupload_preview">
                <label class="imgupload_preview_label" for="imgupload_file"></label>
            </div>
            <input type="file" name="imgupload_file" id="imgupload_file" style="position:absolute;clip:rect(0 0 0 0);">

            <input type="hidden" id="imgupload_file_data" name="imgupload_file_data">
        </div>
        <!-- 底栏 开始 -->
        <div id="imgupload_bottombar" class="bottombar bottombar_imgupload">
            <div class="bottombar_box">
                <div class="bottombar_part half">
                    <a class="btn_inner btn btn_shadow btn_color_4 btn_cancel">
                        <span>取消</span>
                    </a>
                </div>
                <div class="bottombar_part">
                    <label class="btn_inner btn btn_shadow btn_color_1" for="imgupload_file">
                        <span>选择文件</span>
                    </label>
                </div>
                <div class="bottombar_part" id="submit_imgupload">
                    <a class="btn_buy btn_inner btn btn_shadow btn_color_2">
                        <span>提交图片</span>
                    </a>
                </div>
            </div>
        </div>

        <div id="crop_bottombar" class="bottombar bottombar_imgupload">
            <div class="bottombar_box">
                <div class="bottombar_part half" id="btn_crop_cancel">
                    <a class="btn_inner btn btn_shadow btn_color_4">
                        <span>取消裁切</span>
                    </a>
                </div>
                <div class="bottombar_part" id="btn_crop_ok">
                    <div class="btn_inner btn btn_shadow btn_color_1">
                        <span>确认裁切</span>
                    </div>
                </div>
            </div>
        </div>
        <!-- 底栏 结束 -->
    </div>
    <!-- 上传图片 结束 -->
    <!-- 条款 开始 -->
    <div id="subplate_clause" class="subplate_wrap hide">
        <div class="mask"></div>
        <div class="subplate">
            <div class="subplate_box">
                <div class="title">《考点注册须知》</div>
                <div class="box">
                    <p>考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知</p>
                    <p>考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知</p>
                    <p>考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知</p>
                </div>
            </div>
        </div>
        <!-- 底栏 开始 -->
        <div class="bottombar">
            <div class="bottombar_box">
                <div class="bottombar_part">
                    <a class="btn_inner btn btn_shadow  btn_cancel">
                        <button disabled class="closes">10</button>
                    </a>
                </div>
            </div>
        </div>
        <!-- 底栏 结束 -->
    </div>
    <!-- 条款 结束 -->

    <!--协议 条款 开始 -->
    <div id="subplate_clauseone" class="subplate_wrap hide">
        <div class="mask"></div>
        <div class="subplate">
            <div class="subplate_box">
                <div class="title">《信息保密须知》</div>
                <div class="box">
                    <p>考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知</p>
                    <p>考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知</p>
                    <p>考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知考生注册须知</p>
                </div>
            </div>
        </div>
        <div class="bottombar">
            <div class="bottombar_box">
                <div class="bottombar_part">
                    <a class="btn_inner btn btn_shadow  btn_cancel" style="height: 40px;">
                        <button disabled class="closeone">10</button>
                    </a>
                </div>
            </div>
        </div>
    </div>
    <!-- 协议  条款 结束 -->


    <script src="./csaa/js/exif.js"></script>
    <script src="./csaa/js/getimgdata.js?v=2"></script>
    <script src="./csaa/js/jcrop/js/jquery.Jcrop.js"></script>
    <link rel="stylesheet" href="./csaa/js/jcrop/css/jquery.Jcrop.css" type="text/css">


    <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=DaPovYeO1apmksvwBnp5N4OD"></script>
    <!-- <script src="../csaa/js/geo.js"></script> -->
    <script>
        // //条款面板的显示
        // $(document).on("click", ".clause_btn", function () {
        //     bodyfixed();
        //     $("#subplate_clause").removeClass("hide");
        // });
        // //点击面板的黑色遮罩或者“取消”按钮，收回面板 #subplate_clause .mask,
        // $(document).on("click", "#subplate_clause .bottombar .btn_cancel", function () {
        //     $("#subplate_clause").addClass("hide");
        //     bodyfixed(0);
        // });
        $(document).on("click", ".clause_btn", function () {
            bodyfixed();
            $("#subplate_clause").removeClass("hide");
            let a = $(".bottombar .btn_cancel .closes")[0];
            a.innerText = "5秒倒计时";
            a.disabled = true
            let i = 5;
            let fa = setInterval(function () {
                if (i == 0) {
                    clearInterval(fa);
                    a.disabled = false
                    a.innerText = "我已阅读";
                    $("[name=clause]")[0].checked = true
                }
                else {
                    a.innerText = "倒计时" + i + "秒";
                    i--;
                }
            }, 1000)
        });
        //点击面板的黑色遮罩或者“取消”按钮，收回面板
        // #subplate_clauseone .mask,  // 黑色面板属性值
        $(document).on("click", "#subplate_clause .mask,#subplate_clause .bottombar .btn_cancel", function () {
            $("#subplate_clause").addClass("hide");
            bodyfixed(0);
        });
        // //点击面板底栏的其他按钮，如“确定”
        $("body").on("click", "#subplate_clause .bottombar .btn_sure", function () {
            $.fn.poptips("你点击了确定");
            $("#subplate_clause").addClass("hide");
            bodyfixed(0);
        });

        // setup();

        // function province_textshow() {
        // 	var tmp_province = ( $("#province").val() != "省份" )?$("#province").val():"--";
        // 	var tmp_city = ( $("#city").val() != "地级市" )?$("#city").val():"";
        // 	var tmp_area = ( $("#area").val() != "市、县级市、县" )?$("#area").val():"";
        // }

        //协议条款面板的显示
        $(document).on("click", ".clause_btnone", function () {
            bodyfixed();
            $("#subplate_clauseone").removeClass("hide");
            let a = $(".bottombar .btn_cancel .closeone")[0];
            a.innerText = "5秒倒计时";
            a.disabled = true
            let i = 5;
            let fa = setInterval(function () {
                if (i == 0) {
                    clearInterval(fa);
                    a.disabled = false
                    a.innerText = "我已阅读";
                    $("[name=clauseone]")[0].checked = true
                }
                else {
                    a.innerText = "倒计时" + i + "秒";
                    i--;
                }
            }, 1000)
        });
        //点击面板的黑色遮罩或者“取消”按钮，收回面板
        // #subplate_clauseone .mask,  // 黑色面板属性值
        $(document).on("click", "#subplate_clauseone .mask,#subplate_clauseone .bottombar .btn_cancel", function () {
            $("#subplate_clauseone").addClass("hide");
            bodyfixed(0);
        });
        // //点击面板底栏的其他按钮，如“确定”
        $("body").on("click", "#subplate_clauseone .bottombar .btn_sure", function () {
            $.fn.poptips("你点击了确定");
            $("#subplate_clauseone").addClass("hide");
            bodyfixed(0);
        });



        //载入省级
        var params = {
            "level": 1,
            "parentId": 0
        };
        $.ajax({
            url: GET_AREA,
            data: params,
            type: "GET",
            dataType: "JSON",
            success: function (data, textStatus) {
                if (typeof data != "object") {
                    data = JSON.parse(data);
                }

                if (data.status == 1) {
                    var fetch_data = data.data;
                    var tmp_option = "";
                    $.each(fetch_data, function (data_i, data_n) {
                        tmp_option += '<option value="' + data_n.code + '">' + data_n.name + '</option>'
                    });
                    $('#province').append(tmp_option);
                    $("#area").prepend($("<option selected=\"selected\"></option>").text("市、县级市、县"));
                } else {
                    $.fn.poptips(data.msg);
                }
            },
            error: function (xhr, textStatus, errorThrown) {
                $.fn.poptips("连接超时，请检查您的网络");
            }
        });
        //选择省 载入市
        $(document).on("change", "#province", function () {
            $('#city').empty();
            $('#area').empty();
            var params = {
                "level": 2,
                "parentId": $(this).val(),
                "code": $(this).val()
            };
            $.ajax({
                url: GET_AREA,
                data: params,
                type: "GET",
                dataType: "JSON",
                success: function (data, textStatus) {
                    if (typeof data != "object") {
                        data = JSON.parse(data);
                    }

                    if (data.status == 1) {
                        var fetch_data = data.data;
                        var tmp_option = "";
                        $.each(fetch_data, function (data_i, data_n) {
                            tmp_option += '<option value="' + data_n.code + '">' + data_n.name + '</option>'
                        });
                        $('#city').append(tmp_option);
                        $("#city").prepend($("<option selected=\"selected\"></option>").text("地级市"));
                    } else {
                        $.fn.poptips(data.msg);
                    }
                },
                error: function (xhr, textStatus, errorThrown) {
                    $.fn.poptips("连接超时，请检查您的网络");
                }
            });
        });
        //选择市 载入区县
        $(document).on("change", "#city", function () {
            $('#area').empty();
            var params = {
                "level": 3,
                "parentId": $(this).val(),
                "code": $(this).val()
            };
            $.ajax({
                url: GET_AREA,
                data: params,
                type: "GET",
                dataType: "JSON",
                success: function (data, textStatus) {
                    if (typeof data != "object") {
                        data = JSON.parse(data);
                    }

                    if (data.status == 1) {
                        var fetch_data = data.data;
                        var tmp_option = "";
                        $.each(fetch_data, function (data_i, data_n) {
                            tmp_option += '<option value="' + data_n.code + '">' + data_n.name + '</option>'
                        });
                        $('#area').append(tmp_option);
                        $("#area").prepend($("<option selected=\"selected\"></option").text("市、县级市、县"));
                    } else {
                        $.fn.poptips(data.msg);
                    }
                },
                error: function (xhr, textStatus, errorThrown) {
                    $.fn.poptips("连接超时，请检查您的网络");
                }
            });
        });

        //上传图片
        $(".imguploadfile").on("change", function () {

            var $tmp_this = $(this);
            var expFilter = /^(image\/jpeg|image\/gif|image\/png)$/i;

            var imgfile = this.files[0];
            if (!expFilter.test(imgfile.type)) {
                $.fn.poptips("图片不支持，仅支持JPG、GIF、PNG图片格式");
                return false;
            }
            if ((imgfile.size / 1024) > 1024) {
                $.fn.poptips("图片大小不能超过1024KB");
                return false;
            }

            //转base64
            var reader = new FileReader();
            if (imgfile) {
                reader.readAsDataURL(imgfile);
            }
            reader.onloadend = function () {
                var base64 = reader.result;

                var params = {
                    "data": base64
                };
                //console.log(params)
                $.ajax({
                    type: "POST",
                    datatype: "json",
                    url: POST_IMG,
                    data: params,
                    timeout: 20000,
                    success: function (data) {
                        if (typeof data != "object") {
                            data = $.parseJSON(data);
                        }
                        if (data.status == 0) {
                            console.log(data.data.src)
                            $tmp_this.closest(".review_imguploadfile_wrap").siblings(".review_imgbox").append("<div class=\"img\" data-url=\"" + data.data.src + "\" style=\"background-image:url(" + data.data.src + ")\"></div>");

                            if ($tmp_this.closest("#license_upload").length > 0) {
                                if ($tmp_this.closest(".review_imguploadfile_wrap").siblings(".review_imgbox").find(".img").length >= 1) {
                                    $tmp_this.hide();
                                    $tmp_this.siblings(".review_imguploadfile_plus").hide();
                                }
                            }
                            if ($tmp_this.closest("#changdi_upload").length > 0) {
                                if ($tmp_this.closest(".review_imguploadfile_wrap").siblings(".review_imgbox").find(".img").length >= 3) {
                                    $tmp_this.hide();
                                    $tmp_this.siblings(".review_imguploadfile_plus").hide();
                                }
                            }
                            if ($tmp_this.closest("#class_upload").length > 0) {
                                if ($tmp_this.closest(".review_imguploadfile_wrap").siblings(".review_imgbox").find(".img").length >= 3) {
                                    $tmp_this.hide();
                                    $tmp_this.siblings(".review_imguploadfile_plus").hide();
                                }
                            }
                            if ($tmp_this.closest("#gate_upload").length > 0) {
                                if ($tmp_this.closest(".review_imguploadfile_wrap").siblings(".review_imgbox").find(".img").length >= 1) {
                                    $tmp_this.hide();
                                    $tmp_this.siblings(".review_imguploadfile_plus").hide();
                                }
                            }

                        } else {
                            //alert( data.msg );
                            $.fn.winktips(data.msg);
                        }
                        return false;
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        $.fn.poptips("连接超时，请检查您的网络");
                    }
                });
            }

        });
        //删除图片
        $(".review_imgbox").on("click", ".img", function () {
            var $tmp_this = $(this);
            $tmp_this.fadeOut(function () {
                $(this).remove();
            });

            if ($tmp_this.siblings(".img").length < 3) {
                $tmp_this.closest(".review_imgbox").siblings(".review_imguploadfile_wrap").find(".imguploadfile").show();
                $tmp_this.closest(".review_imgbox").siblings(".review_imguploadfile_wrap").find(".review_imguploadfile_plus").show();
            }

        });

        //短信验证
        $(document).on("click", "#btn_verification", function (e) {

            var tmp_this = $(this);
            if (tmp_this.hasClass("disabled")) {
                return false;
            } else {
                var phone = $('[name=kaowu_phone]').val();
                if (!phone.match(/^1[3456789][0-9]{9}$/)) {
                    //$(".phone_input").addClass("has-error");
                    $.fn.winktips("请输入11位有效手机号");
                    return false;
                } else {
                    //$(".phone_input").removeClass("has-error");
                }
                $.post(GET_checkUser, {
                    "phone": phone
                }, function (results) {
                    if (results.status == 0) {
                        $.fn.winktips(results.msg);
                        return false;
                    }
                    if (results.status == 1) {
                        $.post(GET_verifyCode, {
                            "phone": phone
                        }, function (data) {
                            if (data.status == 1) {
                                $.fn.winktips(data.msg);
                                $('[name=kaowu_phone]').attr("readonly", "readonly");
                                var InterValObj; //timer变量，控制时间
                                var curCount = 60; //当前剩余秒数
                                //timer处理函数
                                function SetRemainTime() {
                                    if (curCount == 0) {
                                        window.clearInterval(InterValObj); //停止计时器
                                        tmp_this.removeClass("disabled").html("重发验证码"); //启用按钮
                                        $('[name=kaowu_phone]').removeAttr("readonly");
                                    } else {
                                        curCount--;
                                        tmp_this.html(curCount + "秒后重发");
                                    }
                                }
                                tmp_this.addClass("disabled").html(curCount + "秒后重发");
                                InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器，1秒执行一次
                            }
                            if (data.status == 0) {
                                $.fn.winktips(data.msg);
                            }

                        }, "json");

                    }
                }, "json");




            }
        });

        var reg = new RegExp("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$"); //正则表达式
        //失去焦点
        $('[name=kaodian_email]').blur(function () {
            var tmp_email = $("[name=kaodian_email]").val()
            if (!$("[name=kaodian_email]").val() || !reg.test($("[name=kaodian_email]").val())) {
                $.fn.winktips("请正确输入邮箱");
            } else {
                $.post(GET_checkUserEmail, {
                    "email": tmp_email
                }, function (data) {
                    if (data.status == 0) {
                        $("[name=kaodian_email]").val("").focus();
                        $.fn.winktips(data.msg);
                    }
                }, "json");
            }
        })

        //选择金纬度
        var longitude;
        var latitude;
        //form = layui.form;
        var companyPhoto;
        //var environmentPhoto;

        var pois;

        var ac = new BMap.Autocomplete( //建立一个自动完成的对象
            {
                "input": "address",
                "onSearchComplete": function (e) {
                    //console.log(e);
                    pois = e;
                }

            }
        );

        ac.addEventListener("onconfirm", function (e) { //鼠标点击下拉列表后的事件

            var _value = e.item.value;
            console.log("value:" + JSON.stringify(_value));
            $("#address").val(_value.district + _value.street + _value.business);

            var local = new BMap.LocalSearch(_value.city, { //智能搜索
                onSearchComplete: function () {

                    console.log('local:' + local);
                    var pp = local.getResults().getPoi(0).point; //获取第一个智能搜索的结果
                    //console.log(local);
                    //console.log(local.getResults());
                    //console.log('local:' + local);
                    latitude = pp.lat;
                    longitude = pp.lng;
                }
            });
            local.search(_value.street + _value.business);

        });

        //表单错误滚动到相应位置
        function fun_tipshighlight_scroll($tipshighlight_target) {
            if (typeof $tipshighlight_target == "object" && $tipshighlight_target.length) {
                $("html, body").animate({
                    scrollTop: $tipshighlight_target.offset().top - 200
                }, "fast");
            }
        }
        //上传附件
        //$(document).on("click", ".btn_upload", function() {
        $(document).on("change", "#fileUrl", function () {
            if ($("[name=fileUrl]").val() == "") {
                $.fn.winktips("请上传「<strong>文件</strong>」");
                $("[name=fileUrl]").closest(".form_item").addClass("error");
                return false;
            }

            // 恢复进度条的状态
            //背景成绿色
            $(".progress").css("background", "#e6e6e6");
            //归零 隐藏
            $("#mt-progress-length").css({ "width": "0%", "opacity": "1" });
            $("#proInfo").html("上传进度:" + "0%");
            //$("#mt-progress-value").html(0);

            var $tmp_this = $(this).closest(".form_item_con");

            var data = new FormData();
            var $tmp_file = $tmp_this.find("#fileUrl");
            var file_name = $tmp_file[0].files[0].name;
            data.append("file", $tmp_file[0].files[0]);
            //文件格式
            var name = $(this).val();
            var fileName = name.substring(name.lastIndexOf(".") + 1).toLowerCase();
            if (fileName != "docx" && fileName != "doc" && fileName != "pdf") {
                $.fn.winktips("请选择word/pdf格式文件上传！！");
                return false;
            }

            if (($tmp_file[0].files[0].size / 1024) > 2048) {
                $.fn.poptips("文件大小不能超过2M");
                return false;
            }

            $.ajax({
                type: 'post',
                url: UPLOAD_FILE,
                data: data,
                cache: false,
                processData: false,
                contentType: false,
                enctype: 'multipart/form-data',
                xhr: function () {
                    //获取ajax中的ajaxSettings的xhr对象  为他的upload属性绑定progress事件的处理函数
                    var myXhr = $.ajaxSettings.xhr();
                    console.log(myXhr)
                    if (myXhr.upload) {
                        //检查其属性upload是否存在
                        myXhr.upload.addEventListener("progress", resultProgress, false);
                    }
                    return myXhr;
                },
                success: function (data) {
                    if (typeof data != "object") {
                        data = JSON.parse(data);
                    }
                    var fetch_data = data.data;
                    $("#fileUrl").siblings(".review_filebox").html("");
                    if (data.status == 0) {
                        $tmp_this.find(".review_filebox").append("<div class=\"fileitem\" data-url=\"" + fetch_data.src + "\"><div class=\"text\">" + file_name + "</div><div class=\"del\">删除</div></div>");

                        if ($tmp_this.find(".review_filebox .fileitem").length >= 1) {
                            $tmp_this.find(".btn_upload").hide();
                            $tmp_this.find(".fileUrl").val("");
                        }
                    } else {
                        $.fn.winktips(data.msg);
                        $("#proInfo").text("上传进度：" + data.msg);
                        //更新进度条
                        //$("#progress").width(data);
                    }
                },
                error: function (data) {
                    $.fn.winktips("上传失败");
                }
            })
        });
        //上传进度回调函数
        function resultProgress(e) {
            if (e.lengthComputable) {
                var percent = e.loaded / e.total * 100;
                console.log(percent)
                var percentStr = String(percent);
                if (percentStr == "100") {
                    percentStr = "100.0";
                }
                percentStr = percentStr.substring(0, percentStr.indexOf("."));
                $("#mt-progress-value").html(percentStr + "%");
                $("#mt-progress-length").css("width", percentStr + "%");
                $("#proInfo").html("上传进度:" + percentStr + "%");

                if (percentStr == "100") {
                    setTimeout(function () {
                        //背景成绿色
                        $(".progress").css("background", "#15AD66");
                        //归零 隐藏
                        $("#mt-progress-length").css({ "width": "0%", "opacity": "0" });
                    }, 500);


                }
            }
        }
        //删除文件
        $(".review_filebox").on("click", ".del", function () {
            var $tmp_this = $(this);
            // 恢复进度条的状态
            //背景成绿色
            $(".progress").css("background", "#e6e6e6");
            //归零 隐藏
            $("#mt-progress-length").css({ "width": "0%", "opacity": "1" });
            $("#proInfo").html("上传进度:" + "0%");
            $tmp_this.closest(".fileitem").fadeOut(function () {
                $(this).remove();
            });
            $tmp_this.closest(".review_filebox").siblings(".btn_upload").show();
        });
        //检测用户名
        $("[name=account_number]").blur(function () {
            var $tmp_userName = $("[name=account_number]").val();
            if (!$("[name=account_number]").val()) {
                $.fn.winktips("请输入用户名");
                fun_tipshighlight_scroll($("[name=account_number]"));
                $("[name=account_number]").focus();
                return false;
            } else {
                var reg = /.*[\u4e00-\u9fa5]+.*$/;
                if (reg.test($("[name=account_number]").val())) {
                    $.fn.winktips("用户名请输入字母或数字");
                    fun_tipshighlight_scroll($("[name=account_number]"));
                    return false;
                }
            }
            $.post(CHECK_USERNAME, {
                "userName": $("[name=account_number]").val()
            }, function (data) {
                if (typeof data != "object") {
                    data = $.parseJSON(data);
                }
                if (data.status == 1) {
                    $.fn.winktips(data.msg);
                } else {
                    $.fn.winktips(data.msg);
                    $("[name=account_number]").val("").focus();
                }

            }, "json");
        })
        //注册
        $("#btn_sumbit").on('click', function () {
            var $this_btn = $(this);
            var tmp_parms = {
                "level": '0',
                "roleCode": "examin",
                "name": $("[name=company]").val(), //考点名称
                "userName": $("[name=account_number]").val(), //用户名
                "passWord": $("[name=password]").val(), //密码
                "provno": $("[name=province]").val(), //省
                "cityno": $("[name=city]").val(), //市
                "areacode": $("[name=area]").val(), //区县
                "companyAddress": $("[name=detail_area]").val(), //详细地址
                "latitude": latitude, //纬度
                "longitude": longitude, //经度
                "address": $("[name=companyAddress]").val(), //经纬详细地址
                "chargeName": $("[name=fuze_name]").val(), //负责人名
                "chargePost": $("[name=fuze_job]").val(), //负责人职务
                "chargePhone": $("[name=fuze_phone]").val(), //负责人电话
                "examinationName": $("[name=kaowu_name]").val(), //考务名
                "examinationPost": $("[name=kaowu_job]").val(), //考务职能
                "examinationPhone": $("[name=kaowu_phone]").val(), //考务电话
                "code": $("[name=enroll_verification_code]").val(), //短信验证码
                "email": $("[name=kaodian_email]").val(), //邮箱
                "mobile": $("[name=kaodian_tel]").val(), //固话
                "companyPhoto": '', //单位证件照
                "fieldPhoto": '', //场地照
                "classroomPhoto": '', //教室照
                "gatePhoto": '', //大门照
                "fileUrl": '' //文档
            };

            var license_img = [];
            var changdi_img = [];
            var class_img = [];
            var gate_img = [];

            //账号
            if (!$("[name=account_number]").val()) {
                $.fn.winktips("请输入账号");
                fun_tipshighlight_scroll($("[name=account_number]"));
                $("[name=account_number]").focus();
                return false;
            } else {
                var reg = /.*[\u4e00-\u9fa5]+.*$/;
                if (reg.test($("[name=account_number]").val())) {
                    $.fn.winktips("用户名请输入字母或数字");
                    fun_tipshighlight_scroll($("[name=account_number]"));
                    return false;
                }
            }
            //密码
            if (!$("[name=password]").val()) {
                $.fn.winktips("请输入密码");
                fun_tipshighlight_scroll($("[name=password]"));
                $("[name=password]").focus();
                return false;
            }
            //考点名称
            if (!$("[name=company]").val()) {
                $.fn.winktips("请输入考点名称");
                fun_tipshighlight_scroll($("[name=company]"));
                $("[name=company]").focus();
                return false;
            }
            //单位地址
            if ($("[name=province]").val() == "省份") {
                $.fn.winktips("请选择单位地址");
                fun_tipshighlight_scroll($("[name=province]"));
                $("[name=province]").focus();
                return false;
            }
            //考点金纬度
            //    if ( !$("[name=lat]").val() ) {
            // 	$.fn.winktips("请选择考点经纬度");
            // 	fun_tipshighlight_scroll($("[name=lat]"));
            // 	$("[name=lat]").focus();
            // 	return false;
            //   }
            //考点金纬度
            if (!$("[name=companyAddress]").val()) {
                $.fn.winktips("请选择考点经纬度");
                fun_tipshighlight_scroll($("[name=companyAddress]"));
                $("[name=companyAddress]").focus();
                return false;
            }
            //考点负责人姓名
            if (!$("[name=fuze_name]").val()) {
                $.fn.winktips("请输入考点负责人姓名");
                fun_tipshighlight_scroll($("[name=fuze_name]"));
                $("[name=fuze_name]").focus();
                return false;
            }
            //负责人职务
            if (!$("[name=fuze_job]").val()) {
                $.fn.winktips("请输入负责人职务");
                fun_tipshighlight_scroll($("[name=fuze_job]"));
                $("[name=fuze_job]").focus();
                return false;
            }
            //负责人联系方式
            if (!$("[name=fuze_phone]").val() || !$("[name=fuze_phone]").val().match(/^1[3456789][0-9]{9}$/)) {
                $.fn.winktips("请正确输入负责人联系方式");
                fun_tipshighlight_scroll($("[name=fuze_phone]"));
                $("[name=fuze_phone]").focus();
                return false;
            }
            var reg = new RegExp("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$"); //正则表达式
            //考点联系邮箱
            if (!$("[name=kaodian_email]").val() || !reg.test($("[name=kaodian_email]").val())) {
                $.fn.winktips("请输入考点联系邮箱");
                fun_tipshighlight_scroll($("[name=kaodian_email]"));
                $("[name=kaodian_email]").focus();
                return false;
            }
            //固话
            var mobile_reg = new RegExp(/^\d{3}-\d{7,8}|\d{4}-\d{7,8}$/);
            if (!$("[name=kaodian_tel]").val() || !mobile_reg.test($("[name=kaodian_tel]").val())) {
                $.fn.winktips("请正确输入固话");
                fun_tipshighlight_scroll($("[name=kaodian_tel]"));
                $("[name=kaodian_tel]").focus();
                return false;
            }
            //单位执照
            if ($("#license_upload .img").length) {
                $("#license_upload .review_imgbox .img").each(function () {
                    license_img.push($(this).data("url"));
                });
                //var s = a.toString();
                tmp_parms.companyPhoto = license_img.toString();

            } else {
                $.fn.winktips("请上传单位执照");
                fun_tipshighlight_scroll($("#license_upload")) //表单错误滚动到相应位置

                return false;
            }
            //场地照
            if ($("#changdi_upload .img").length) {
                $("#changdi_upload .review_imgbox .img").each(function () {
                    changdi_img.push($(this).data("url"));
                });
                tmp_parms.fieldPhoto = changdi_img.toString()
            } else {
                $.fn.winktips("请上传场地照");
                fun_tipshighlight_scroll($("#changdi_upload")) //表单错误滚动到相应位置
                return false;
            }
            //教室照
            if ($("#class_upload .img").length) {
                $("#class_upload .review_imgbox .img").each(function () {
                    class_img.push($(this).data("url"));
                });
                tmp_parms.classroomPhoto = class_img.toString()
            } else {
                $.fn.winktips("请上传教师照");
                fun_tipshighlight_scroll($("#class_upload")) //表单错误滚动到相应位置
                return false;
            }
            //大门照
            if ($("#gate_upload .img").length) {
                $("#gate_upload .review_imgbox .img").each(function () {
                    gate_img.push($(this).data("url"));
                });
                tmp_parms.gatePhoto = gate_img.toString()
            } else {
                $.fn.winktips("请上传正门照");
                fun_tipshighlight_scroll($("#gate_upload")) //表单错误滚动到相应位置
                return false;
            }
            //文档
            if (!$(".review_filebox .fileitem").length) {
                $.fn.winktips("请上传「<strong>文档</strong>」");
                $("[name=fileUrl]").closest(".form_item_con").addClass("error");
                return false;
            } else {
                tmp_parms.fileUrl = $(".review_filebox .fileitem").data("url");
            }
            //考务联系人姓名
            if (!$("[name=kaowu_name]").val()) {
                $.fn.winktips("请输入考务联系人姓名");
                fun_tipshighlight_scroll($("[name=kaowu_name]"));
                $("[name=kaowu_name]").focus();
                return false;
            }
            //联系人职务
            if (!$("[name=kaowu_job]").val()) {
                $.fn.winktips("请输入联系人职务");
                fun_tipshighlight_scroll($("[name=kaowu_job]"));
                $("[name=kaowu_job]").focus();
                return false;
            }
            //联系人手机号
            if (!$("[name=kaowu_phone]").val() || !$("[name=kaowu_phone]").val().match(/^1[3456789][0-9]{9}$/)) {
                $.fn.winktips("请正确输入联系人手机号");
                fun_tipshighlight_scroll($("[name=kaowu_phone]"));
                $("[name=kaowu_phone]").focus();
                return false;
            }
            //短信验证码
            if (!$("[name=enroll_verification_code]").val()) {
                $.fn.winktips("请输入短信验证码");
                fun_tipshighlight_scroll($("[name=enroll_verification_code]"));
                $("[name=enroll_verification_code]").focus();
                return false;
            }
            //规则
            if (!$("[name=clause]").is(":checked")) {
                $.fn.winktips("请勾选规则");
                fun_tipshighlight_scroll($("[name=clause]")) //表单错误滚动到相应位置
                return false
            }

            if (!$("[name=clauseone]").is(":checked")) {
                $.fn.winktips("请勾选规则");
                fun_tipshighlight_scroll($("[name=clauseone]")) //表单错误滚动到相应位置
                return false
            }
            //console.log(tmp_parms)
            $.ajax({
                type: "POST",
                url: REG_KDADD,
                dataType: "json",
                data: tmp_parms,
                timeout: 20000,
                beforeSend: function (XMLHttpRequest) {
                    $this_btn.addClass("disabled").text("提交中……");
                },
                success: function (data, textStatus) {
                    if (data.status == 1) {

                        $.fn.poptips({
                            title: "注册成功", //默认为空
                            con: "是否前往登录？",
                            conCenter: false, //文本内容内容是否居中，默认居中
                            //btnOK: false, //是否显示确认按钮 默认显示
                            btnCancel: true, //是否显示取消按钮 默认不显示
                            btnOKText: "去登录", //确认按钮的文案
                            btnCancelText: "取消", //取消按钮的文案
                            btnOKClick: function () { //确认按钮点击事件（没有按钮时遵从此事件）
                                window.location.href = "./login.html";
                            },
                            btnCancelClick: function () { //取消按钮点击事件
                                window.location.reload(true)
                            }
                        });


                    } else if (data.status == 0) {
                        $.fn.winktips(data.msg);
                    } else {
                        $.fn.winktips("提交失败");
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    $.fn.winktips("连接超时，请检查您的网络");
                },
                complete: function () {
                    $this_btn.removeClass("disabled").text("立即提交");
                }
            });

        })
    </script>

    <!-- <script>
    document.getElementById('open').onclick = function () {
        if (document.getElementById('allmap').style.display == 'none') {
            document.getElementById('allmap').style.display = 'block';
        } else {
            document.getElementById('allmap').style.display = 'none';
        }
    }

    var map = new BMap.Map("allmap");
    var geoc = new BMap.Geocoder();   //地址解析对象
    var markersArray = [];
    var geolocation = new BMap.Geolocation();

   	//初始化百度地图

    var point = new BMap.Point(116.404,39.915);
	map.centerAndZoom(point, 50); // 中心点

    geolocation.getCurrentPosition(function (r) {
        if (this.getStatus() == BMAP_STATUS_SUCCESS) {
            var mk = new BMap.Marker(r.point);
            map.addOverlay(mk);
            map.panTo(r.point);
            map.enableScrollWheelZoom(true);
        }
        else {
            alert('failed' + this.getStatus());
        }
    }, {enableHighAccuracy: true})
    map.addEventListener("click", showInfo);


    //清除标识
    function clearOverlays() {
        if (markersArray) {
            for (i in markersArray) {
                map.removeOverlay(markersArray[i])
            }
        }
    }
    //地图上标注
    function addMarker(point) {
        var marker = new BMap.Marker(point);
        markersArray.push(marker);
        clearOverlays();
        map.addOverlay(marker);
    }
    //点击地图时间处理
    function showInfo(e) {
        document.getElementById('lng').value = e.point.lng;
        document.getElementById('lat').value =  e.point.lat;
        geoc.getLocation(e.point, function (rs) {
            var addComp = rs.addressComponents;
            var address = addComp.province + addComp.city + addComp.district + addComp.street + addComp.streetNumber;
            //if (confirm("确定考点地址是——" + address + "?")) {
			if (confirm("确定这里是考点地址吗？")) {
                document.getElementById('allmap').style.display = 'none';
                document.getElementById('address').value = address;
            }
        });
        addMarker(e.point);
    }
</script> -->
</body>

</html>
